home *** CD-ROM | disk | FTP | other *** search
- // UndoDlg.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "vcdemo.h"
- #include "UndoDlg.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CUndoDlg dialog
-
-
- CUndoDlg::CUndoDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CUndoDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CUndoDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
-
-
- void CUndoDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CUndoDlg)
- DDX_Control(pDX, IDC_SGCTRL1, m_ctrl);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CUndoDlg, CDialog)
- //{{AFX_MSG_MAP(CUndoDlg)
- ON_BN_CLICKED(IDC_BUTTON_DISCARD, OnButtonDiscard)
- ON_BN_CLICKED(IDC_BUTTON_REDO, OnButtonRedo)
- ON_BN_CLICKED(IDC_BUTTON_UNDO, OnButtonUndo)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CUndoDlg message handlers
-
- void CUndoDlg::OnButtonDiscard()
- {
- // TODO: Add your control notification handler code here
- m_ctrl.DoDiscardUndo();
- }
-
- void CUndoDlg::OnButtonRedo()
- {
- // TODO: Add your control notification handler code here
- if( m_ctrl.DoGetRedoState() )
- m_ctrl.DoRedo();
- else
- AfxMessageBox( "Can't redo now" );
- }
-
- void CUndoDlg::OnButtonUndo()
- {
- // TODO: Add your control notification handler code here
- if( m_ctrl.DoGetUndoState() )
- m_ctrl.DoUndo();
- else
- AfxMessageBox( "Can't undo now" );
- }
-
- BOOL CUndoDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_ctrl.SetPageLabelVisible( FALSE );
- COleVariant var( "VCDEMO" );
- m_ctrl.DoSetMessageTitle( var );
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
-